package com.vne.skyemart.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "screen",catalog = "skyemart_db")
public class Screen implements Serializable{

	private static final long serialVersionUID = -5172224532825248692L;
	@Id
	@Column(name = "ScreenID", nullable = false, length = 20)
	private String screenID;
	
	@Column(name = "ScreenName", nullable = false, length = 50)
	private String screenName;	
	
	@Column(name = "Description",length = 250)
	private String description;
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "pk.screen", cascade = CascadeType.ALL)
	private Set<Permission> permissions = new HashSet<Permission>(0);
	
	public Screen() {}
	
	
	public Screen(String screenID, String screenName, String description) {
		this.screenID = screenID;
		this.screenName = screenName;
		this.description = description;
	}

	public Screen(String screenID, String screenName, String description,
			Set<Permission> permissions) {
		this.screenID = screenID;
		this.screenName = screenName;
		this.description = description;
		this.permissions = permissions;
	}


	public String getScreenID() {
		return screenID;
	}

	public void setScreenID(String screenID) {
		screenID = this.screenID;
	}

	public String getScreenName() {
		return screenName;
	}

	public void setScreenName(String screenName) {
		screenName = this.screenName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		description = this.description;
	}
	
	public Set<Permission> getPermissions() {
		return permissions;
	}

	public void setPermissions(Set<Permission> permissions) {
		this.permissions = permissions;
	}
}
